/*
 * Copyright (c) [2012] - [2017] Red Hat, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Red Hat, Inc. - initial API and implementation
 */
package com.codenvy.ide.hosted.client.action;

import com.codenvy.ide.hosted.client.HostedLocalizationConstant;
import com.google.inject.Inject;
import org.eclipse.che.ide.api.action.Action;
import org.eclipse.che.ide.api.action.ActionEvent;
import org.eclipse.che.ide.util.browser.BrowserUtils;

/**
 * Open view with product documentation.
 *
 * @author Ann Shumilova
 */
public class OpenDocsAction extends Action {
  private final HostedLocalizationConstant locale;

  @Inject
  public OpenDocsAction(HostedLocalizationConstant locale) {
    super(locale.actionOpenDocsTitle(), locale.actionOpenDocsDescription(), null, null);
    this.locale = locale;
  }

  /** {@inheritDoc} */
  @Override
  public void actionPerformed(ActionEvent e) {
    BrowserUtils.openInNewTab(locale.actionOpenDocsUrl());
  }
}
